home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / NGL2.0.1J(68k).sit / NGL2.0.1J(68k) / Pict Effect Sample / Pict Effect Sample2.c < prev    next >
C/C++ Source or Header  |  1996-09-19  |  4KB  |  175 lines

  1. /*============================================================
  2.  
  3.                     N_PICT サンプルプログラム(マルチウィンドウ)
  4.                     
  5. ============================================================*/
  6. #include        "N_Library.h"
  7.  
  8. void            Bt_Check(void);
  9. short        Data_Rsrc = 0;
  10. long            wait;
  11.  
  12. void main(void)
  13. {
  14.     short        i;
  15.     WindowPtr    window;
  16.  
  17.     ToolboxInit();
  18.     ColorCheck();
  19.     HideCursor();
  20.     window = GetNewWindow (129,nil,(WindowPtr)-1L );
  21.     ShowWindow(window);
  22.     SetWTitle(window,"¥pWindow1");
  23.     N_Window_Set_Multi(1,window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),320,240);
  24.     window = GetNewWindow (129,nil,(WindowPtr)-1L );
  25.     MoveWindow(window,-(window->portBits.bounds.left)+100,-(window->portBits.bounds.top)+100,false);
  26.     SetWTitle(window,"¥pWindow2");
  27.     ShowWindow(window);
  28.     N_Window_Set_Multi(0,window,-(window->portBits.bounds.left),-(window->portBits.bounds.top),320,240);
  29.  
  30.     Open_Resource_File(128,1,&Data_Rsrc);
  31.     N_Pict_Draw(129,0,0,0,false);                            //画像をバッファに読み込む(非表示)
  32.     N_Pict_Draw(130,0,0,0,false);
  33.     Close_Resource_File(&Data_Rsrc);
  34.  
  35.     for (i=0;i!=60;i++)                                        //瞬時切り替え
  36.     {
  37.         N_Current_Window_Set(0);
  38.         N_Pict_Draw(130,0,0,(GrafPtr)Main_Window,true);        //バッファに一度読んだ画像は瞬時に表示できる
  39.         N_Current_Window_Set(1);
  40.         N_Pict_Draw(130,0,0,(GrafPtr)Main_Window,true);
  41.         N_Current_Window_Set(2);
  42.         N_Pict_Draw(129,0,0,(GrafPtr)Main_Window,true);
  43.         N_Current_Window_Set(0);
  44.         N_Pict_Draw(129,0,0,(GrafPtr)Main_Window,true);
  45.         N_Current_Window_Set(1);
  46.         N_Pict_Draw(129,0,0,(GrafPtr)Main_Window,true);
  47.         N_Current_Window_Set(2);
  48.         N_Pict_Draw(130,0,0,(GrafPtr)Main_Window,true);
  49.         Bt_Check();
  50.     }
  51.     Delay(10,&wait);
  52.  
  53.     do
  54.     {
  55.         for (i=1;i!=17;i++)                                    //モザイクを大きくしていく(Ef0)
  56.         {
  57.             N_Current_Window_Set(0);
  58.             N_Pict_Effect (129,0,0,0,i,0);
  59.             N_Current_Window_Set(1);
  60.             N_Pict_Effect (129,0,0,0,i,0);
  61.             Bt_Check();
  62.         }
  63.  
  64.         for (i=16;i!=0;i--)                                    //モザイクを小さくしていく(Ef0)
  65.         {
  66.             N_Current_Window_Set(0);
  67.             N_Pict_Effect (130,0,0,0,i,0);
  68.             N_Current_Window_Set(1);
  69.             N_Pict_Effect (130,0,0,0,i,0);
  70.             Bt_Check();
  71.         }
  72.         Delay(30,&wait);
  73.  
  74.         for (i=1;i!=16;i++)                                    //(Ef1)                        
  75.         {
  76.             N_Current_Window_Set(0);
  77.             N_Pict_Effect (129,0,0,1,15,i);
  78.             N_Current_Window_Set(1);
  79.             N_Pict_Effect (129,0,0,1,15,i);
  80.             Bt_Check();
  81.         }
  82.         Delay(30,&wait);
  83.  
  84.         for (i=1;i!=16;i++)                                    //(Ef2)        
  85.         {
  86.             N_Current_Window_Set(0);
  87.             N_Pict_Effect (130,0,0,2,15,i);
  88.             N_Current_Window_Set(1);
  89.             N_Pict_Effect (130,0,0,2,15,i);
  90.             Bt_Check();
  91.         }
  92.         Delay(30,&wait);
  93.  
  94.         N_Current_Window_Set(0);
  95.         N_Pict_Effect (129,0,0,3,0,0);                        //(Ef3)        
  96.         N_Current_Window_Set(1);
  97.         N_Pict_Effect (129,0,0,3,0,0);                        //(Ef3)        
  98.         for (i=0;i!=256;i++)
  99.         {
  100.             N_Current_Window_Set(0);
  101.             N_Pict_Effect (129,0,0,3,1,0);
  102.             N_Current_Window_Set(1);
  103.             N_Pict_Effect (129,0,0,3,1,0);
  104.             Bt_Check();
  105.         }
  106.         Delay(30,&wait);
  107.  
  108.  
  109.         for (i=1;i!=17;i++)                                    //モザイクを大きくしていく(Ef0)
  110.         {
  111.             N_Current_Window_Set(0);
  112.             N_Pict_Effect (129,0,0,0,i,0);
  113.             N_Current_Window_Set(1);
  114.             N_Pict_Effect (129,0,0,0,i,0);
  115.             Bt_Check();
  116.         }
  117.  
  118.         for (i=16;i!=0;i--)                                    //モザイクを小さくしていく(Ef0)
  119.         {
  120.             N_Current_Window_Set(0);
  121.             N_Pict_Effect (130,0,0,0,i,0);
  122.             N_Current_Window_Set(1);
  123.             N_Pict_Effect (130,0,0,0,i,0);
  124.             Bt_Check();
  125.         }
  126.         Delay(30,&wait);
  127.  
  128.         for (i=1;i!=9;i++)                                    //(Ef2)        
  129.         {
  130.             N_Current_Window_Set(0);
  131.             N_Pict_Effect (129,0,0,2,8,i);
  132.             N_Current_Window_Set(1);
  133.             N_Pict_Effect (129,0,0,2,8,i);
  134.             Bt_Check();
  135.         }
  136.         Delay(30,&wait);
  137.  
  138.         for (i=1;i!=9;i++)                                    //(Ef1)                        
  139.         {
  140.             N_Current_Window_Set(0);
  141.             N_Pict_Effect (130,0,0,1,8,i);
  142.             N_Current_Window_Set(1);
  143.             N_Pict_Effect (130,0,0,1,8,i);
  144.             Bt_Check();
  145.         }
  146.         Delay(30,&wait);
  147.  
  148.         N_Current_Window_Set(0);
  149.         N_Pict_Effect (129,0,0,3,0,0);                        //(Ef3)        
  150.         N_Current_Window_Set(1);
  151.         N_Pict_Effect (129,0,0,3,0,0);                        //(Ef3)        
  152.  
  153.         for (i=0;i!=256;i++)
  154.         {
  155.             N_Current_Window_Set(0);
  156.             N_Pict_Effect (129,0,0,3,1,0);
  157.             N_Current_Window_Set(1);
  158.             N_Pict_Effect (129,0,0,3,1,0);
  159.             Bt_Check();
  160.         }
  161.         Delay(30,&wait);
  162.     }
  163.     while (true);
  164. }
  165.  
  166. void Bt_Check(void)
  167. {
  168.     if (Button()==true)
  169.     {
  170.         ColorRevert();
  171.         ShowCursor();
  172.         ExitToShell();
  173.     }
  174. }    
  175.